﻿using System;
using System.Collections.Generic;
using System.Text;

namespace AnnieSharp
{
    /// <summary>
    /// annie引擎的基类
    /// @class annie.AObject
    /// </summary>
    public abstract class AObject:IDisposable
    {
        protected long _instanceId = 0;
        protected string _instanceType = "annie.AObject";
        protected static long _object_id = 0;

        public AObject()
        {
            _instanceId = _object_id++;
        }

        /// <summary>
        /// 每一个annie引擎对象都会有一个唯一的id码。
        /// </summary>
        public long instanceId
        {
            get
            {
                return _instanceId;
            }
        }




        /// <summary>
        /// 销毁一个对象
        /// 销毁之前一定要做完其他善后工作，否则有可能会出错
        /// </summary>
        public virtual void Destroy() {

        }

        public void Dispose()
        {
            Destroy();
        }
    }




    /// <summary>
    /// 事件触发基类
    /// </summary>
    public class EventDispatcher : AObject
    {
        public EventDispatcher()
        {
            _instanceType = "annie.EventDispatcher";
        }


    }
}
